/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.br.telas;

import com.br.utils.Util;

/**
 *
 * @author Cassiano
 */
public class TelaCliente extends javax.swing.JDialog {

    /**
     * Creates new form TelaCliente
     */
    public TelaCliente(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        
            //centralizar a tela
             Util.centralizar(this);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        radioBtPesquisa = new javax.swing.ButtonGroup();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        abaManuClientes = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabelaCliente = new javax.swing.JTable();
        painelBotoes = new javax.swing.JPanel();
        btCadastrar = new javax.swing.JButton();
        btAlterar = new javax.swing.JButton();
        btVisualizar = new javax.swing.JButton();
        btAtivar = new javax.swing.JButton();
        btInativar = new javax.swing.JButton();
        btSair = new javax.swing.JButton();
        painelPesquisa = new javax.swing.JPanel();
        radioId = new javax.swing.JRadioButton();
        radioNome = new javax.swing.JRadioButton();
        radioTelefone = new javax.swing.JRadioButton();
        txPesquisa = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        comboTipo = new javax.swing.JComboBox();
        btPesquisa = new javax.swing.JButton();
        abaRelatoriosClientes = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Manutenção Clientes");

        jTabbedPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        tabelaCliente.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Nome", "Telefone", "Indereço", "Status"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabelaCliente.setColumnSelectionAllowed(true);
        tabelaCliente.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(tabelaCliente);
        tabelaCliente.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        if (tabelaCliente.getColumnModel().getColumnCount() > 0) {
            tabelaCliente.getColumnModel().getColumn(0).setResizable(false);
            tabelaCliente.getColumnModel().getColumn(1).setResizable(false);
            tabelaCliente.getColumnModel().getColumn(2).setResizable(false);
            tabelaCliente.getColumnModel().getColumn(3).setResizable(false);
            tabelaCliente.getColumnModel().getColumn(4).setResizable(false);
        }

        painelBotoes.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        btCadastrar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btCadastrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/br/imagens/casdastrar.png"))); // NOI18N
        btCadastrar.setText("Cadastrar");
        painelBotoes.add(btCadastrar);

        btAlterar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/br/imagens/alterar.png"))); // NOI18N
        btAlterar.setText("Alterar");
        painelBotoes.add(btAlterar);

        btVisualizar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btVisualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/br/imagens/visualizar.png"))); // NOI18N
        btVisualizar.setText("Visualizar");
        painelBotoes.add(btVisualizar);

        btAtivar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btAtivar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/br/imagens/acessar.png"))); // NOI18N
        btAtivar.setText("Ativar");
        painelBotoes.add(btAtivar);

        btInativar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btInativar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/br/imagens/inativar.png"))); // NOI18N
        btInativar.setText("Inativar");
        btInativar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tionPerformed(evt);
            }
        });
        painelBotoes.add(btInativar);

        btSair.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/br/imagens/sairTelas.png"))); // NOI18N
        btSair.setText("Sair");
        btSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSairActionPerformed(evt);
            }
        });
        painelBotoes.add(btSair);

        painelPesquisa.setBorder(javax.swing.BorderFactory.createTitledBorder("Pesquisar Clientes"));

        radioBtPesquisa.add(radioId);
        radioId.setText("Id");

        radioBtPesquisa.add(radioNome);
        radioNome.setSelected(true);
        radioNome.setText("Nome");

        radioBtPesquisa.add(radioTelefone);
        radioTelefone.setText("Telefone");

        jLabel1.setText("Tipo:");

        comboTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Todos", "Ativos", "Inativos", " " }));

        btPesquisa.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btPesquisa.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/br/imagens/pesquisar.png"))); // NOI18N
        btPesquisa.setText("Pesquisar");

        javax.swing.GroupLayout painelPesquisaLayout = new javax.swing.GroupLayout(painelPesquisa);
        painelPesquisa.setLayout(painelPesquisaLayout);
        painelPesquisaLayout.setHorizontalGroup(
            painelPesquisaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelPesquisaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelPesquisaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelPesquisaLayout.createSequentialGroup()
                        .addComponent(radioId)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(radioNome)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(radioTelefone)
                        .addGap(0, 429, Short.MAX_VALUE))
                    .addComponent(txPesquisa))
                .addGap(18, 18, 18)
                .addGroup(painelPesquisaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(comboTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addGap(41, 41, 41)
                .addComponent(btPesquisa)
                .addGap(21, 21, 21))
        );
        painelPesquisaLayout.setVerticalGroup(
            painelPesquisaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelPesquisaLayout.createSequentialGroup()
                .addGroup(painelPesquisaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelPesquisaLayout.createSequentialGroup()
                        .addGroup(painelPesquisaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(radioId)
                            .addComponent(radioNome)
                            .addComponent(radioTelefone)
                            .addComponent(jLabel1))
                        .addGap(4, 4, 4)
                        .addGroup(painelPesquisaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(comboTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(painelPesquisaLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(btPesquisa)))
                .addContainerGap())
        );

        javax.swing.GroupLayout abaManuClientesLayout = new javax.swing.GroupLayout(abaManuClientes);
        abaManuClientes.setLayout(abaManuClientesLayout);
        abaManuClientesLayout.setHorizontalGroup(
            abaManuClientesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abaManuClientesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(abaManuClientesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1)
                    .addComponent(painelBotoes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addComponent(painelPesquisa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        abaManuClientesLayout.setVerticalGroup(
            abaManuClientesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abaManuClientesLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(painelPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(painelBotoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Manutenção dos Clientes", abaManuClientes);

        javax.swing.GroupLayout abaRelatoriosClientesLayout = new javax.swing.GroupLayout(abaRelatoriosClientes);
        abaRelatoriosClientes.setLayout(abaRelatoriosClientesLayout);
        abaRelatoriosClientesLayout.setHorizontalGroup(
            abaRelatoriosClientesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 895, Short.MAX_VALUE)
        );
        abaRelatoriosClientesLayout.setVerticalGroup(
            abaRelatoriosClientesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 576, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("Relatórios", abaRelatoriosClientes);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 904, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 608, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void tionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tionPerformed
       
    }//GEN-LAST:event_tionPerformed

    private void btSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSairActionPerformed
        this.dispose();
    }//GEN-LAST:event_btSairActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Windows".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TelaCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TelaCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TelaCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TelaCliente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                TelaCliente dialog = new TelaCliente(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel abaManuClientes;
    private javax.swing.JPanel abaRelatoriosClientes;
    private javax.swing.JButton btAlterar;
    private javax.swing.JButton btAtivar;
    private javax.swing.JButton btCadastrar;
    private javax.swing.JButton btInativar;
    private javax.swing.JButton btPesquisa;
    private javax.swing.JButton btSair;
    private javax.swing.JButton btVisualizar;
    private javax.swing.JComboBox comboTipo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JPanel painelBotoes;
    private javax.swing.JPanel painelPesquisa;
    private javax.swing.ButtonGroup radioBtPesquisa;
    private javax.swing.JRadioButton radioId;
    private javax.swing.JRadioButton radioNome;
    private javax.swing.JRadioButton radioTelefone;
    private javax.swing.JTable tabelaCliente;
    private javax.swing.JTextField txPesquisa;
    // End of variables declaration//GEN-END:variables

}
